package com.zzyl.controller;


import com.zzyl.base.ResponseResult;
import com.zzyl.dto.LoginDto;
import com.zzyl.dto.UserDto;
import com.zzyl.service.LoginService;
import com.zzyl.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    /**
     * 后台管理登录
     * @param dto
     * @return
     */
    @PostMapping("/security/login")
    public ResponseResult<UserVo> login(@RequestBody LoginDto dto){
        UserVo userVo = loginService.login(dto);
        return ResponseResult.success(userVo);
    }
}
